namespace SilverSea.Untilities
{
    using System;
    using System.Timers;

    public class Uptime
    {
        private int int_0;
        private int int_1;
        private int int_2;
        private int int_3;
        private Timer timer_0 = new Timer();

        public Uptime()
        {
            this.timer_0.Interval = 1000.0;
            this.timer_0.Elapsed += new ElapsedEventHandler(this.timer_0_Elapsed);
        }

        private void method_0()
        {
            this.int_3++;
            if (this.int_3 >= 60)
            {
                this.int_3 -= 60;
                this.int_2++;
            }
            if (this.int_2 >= 60)
            {
                this.int_2 -= 60;
                this.int_1++;
            }
            if (this.int_1 >= 0x18)
            {
                this.int_1 -= 0x18;
                this.int_0++;
            }
        }

        public void Start()
        {
            this.timer_0.Start();
        }

        public void Stop()
        {
            this.timer_0.Stop();
            this.int_0 = 0;
            this.int_1 = 0;
            this.int_2 = 0;
            this.int_3 = 0;
        }

        private void timer_0_Elapsed(object sender, EventArgs e)
        {
            this.method_0();
        }

        public override string ToString()
        {
            string str = string.Empty;
            if (this.int_0 > 0)
            {
                str = this.int_0 + " Days ";
            }
            string str2 = str;
            return (str2 + this.int_1.ToString("00") + ":" + this.int_2.ToString("00") + ":" + this.int_3.ToString("00"));
        }

        public int Days
        {
            get
            {
                return this.int_0;
            }
        }

        public int Hours
        {
            get
            {
                return this.int_1;
            }
        }

        public int Minute
        {
            get
            {
                return this.int_2;
            }
        }

        public int Seconds
        {
            get
            {
                return this.int_3;
            }
        }
    }
}

